-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[dotnet] [bidi] Do not throw when CallFunction or Evaluate return exceptional result (breaking change) #15521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
dotnet/src/webdriver/BiDi/Modules/Script/ScriptEvaluateException.cs
Outdated
Show resolved
Hide resolved
Not related to this PR, I added a prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Mike.
Description
In an effort for Selenium's raw BiDi to return the exact response from the endpoint, we should not throw exceptions unless the opt-in
ThrowOnError()
method is called.Motivation and Context
Fixes #15414
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Updated
EvaluateAsync
andCallFunctionAsync
methods to handle exceptional results without throwing exceptions directly.ThrowOnError
method inEvaluateResult
to centralize error handling.EvaluateAsync
andCallFunctionAsync
toEvaluateResult
for consistency.Enhanced error handling by refining
ScriptEvaluateException
to include detailed stack trace information.Adjusted test cases to validate the new
ThrowOnError
behavior and ensure proper handling of exceptional results.EvaluateResultSuccess
and useThrowOnError
for result validation.Improved serialization logic in
ChannelLocalValue
to ensure proper JSON property naming.Changes walkthrough 📝
5 files
Refactored
EvaluateAsync
andCallFunctionAsync
methods for errorhandling
Added
ThrowOnError
method toEvaluateResult
for centralized errorhandling
Improved JSON serialization for `ChannelLocalValue`
Enhanced exception message with detailed stack trace
Removed direct exception throwing in
EvaluateAsync
andCallFunctionAsync
5 files
Updated tests to validate
ThrowOnError
behavior forCallFunctionAsync
Adjusted parameter tests to handle
ThrowOnError
inCallFunctionAsync
Refined remote value tests to use
ThrowOnError
for result validationEnhanced evaluation parameter tests with `ThrowOnError` validation
Updated script command tests to validate `ThrowOnError` behavior